package server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class multiServer {
    private ServerSocket serverSocket;

    public void start(int port) throws IOException {
        serverSocket = new ServerSocket(port);
        while (true){
            Socket socket = serverSocket.accept();
            clientHandler clientHandler = new clientHandler(socket);
            clientList.clientlist.add(clientHandler);
            clientHandler.start();
        }
    }
    public void stop() throws Exception{
        serverSocket.close();
    }


        public static void main(String[] args) {
            try {
                new multiServer().start(6666);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
}

